#region File Header
//----------------------------------------------------------------
// Copyright (C) 2002 Stefan Kyntchev
// All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR 
// FITNESS FOR A PARTICULAR PURPOSE.
//----------------------------------------------------------------
#endregion File Header

using System;
using System.IO;
using System.Collections;

namespace AirWeb.DirectoryMgr
{
	/// <summary>
	/// Summary description for FileFilter.
	/// </summary>
	public class DateFilter
	{
		int m_days;

		public DateFilter(int i_days)
		{
			m_days = i_days;
		}

		public void DateFilterInclude(FileSystemInfo i_di, ArrayList i_currentContent, ref bool i_include)
		{
			// If previous filter has set the include to false - just return
			if(i_include == false)
				return;

			DateTime cutoff = DateTime.Now;
			cutoff = cutoff.AddDays(m_days*-1);

			if(i_di.LastWriteTime > cutoff)
				i_include = true;
			else
				i_include = false;
		}
	}
}
